package com.wx.md.adb;

import com.android.ddmlib.MultiLineReceiver;

import java.util.ArrayList;
import java.util.List;

public class GenericReceiver extends MultiLineReceiver {

    private List<String> resultStrs = new ArrayList<>();



    public boolean isExist(String content){
        for(String string:resultStrs){
           String[] splitStrs =  string.split(" ");
           for(String str:splitStrs){
               if(str.equals(content)){
                   return true;
               }
           }
        }
        return  false;
    }


    @Override
    public void processNewLines(String[] strings) {
            for(String string:strings){
                System.out.println(string);
                resultStrs.add(string);
            }
    }

    @Override
    public boolean isCancelled() {
        return false;
    }
}
